from myelin.server.nodetype.Transform import Transform


class Transform(Transform):
    
    def process(self, context, source):
        nodeType = context.nodeType
        
        model = nodeType.retrieveModel(context)
        
        src = model.dcSource
        if src:
            context.return_resource = src[0].rdf_getDomain()
        else:
            from Ft.Server.Server import FtServerServerException
            from Ft.Server.Server import Error
            raise FtServerServerException(
                Error.RESOURCE_NOT_FOUND,
                uri = model.rdf_value
            )
                
        return None, None, None